package org.gaojianqiao.electronichandbook.database;

import java.io.UnsupportedEncodingException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import org.gaojianqiao.electronichandbook.createtable.History;
import org.gaojianqiao.electronichandbook.createtable.MarkTable;

import zyg.login.DataBas;

public class OpertateMarkTable
{
	public ArrayList<MarkTable> Marklist(String bookName) throws SQLException,
			UnsupportedEncodingException
	{

		// TODO Auto-generated method stub

		String sql = "select * from " + bookName;
		DataBas publicDataBase = new DataBas();
		publicDataBase.connectDB("data3");
		ResultSet rs = publicDataBase.stmt.executeQuery(sql);
		ArrayList<MarkTable> MarkList = new ArrayList<MarkTable>();
		while (rs.next())
		{
			MarkTable mark = new MarkTable();
			mark.setMarkId(rs.getString("Markid"));
			mark.setMarkTablename(rs.getString("MarkTablename"));
			mark.setMarkString(rs.getString("MarkString"));

		}
		publicDataBase.closeDB();

		return MarkList;
	}

}
